<template>
	<tm-fullView>
		<tm-menubars :title="$t('搜索好友')" iconColor="white" :showback="true"/>
		<tm-search :shadow="0" :placeholder="$t('请输入邮箱或者通讯号')" 
			@focus="showRightSearch=true" @blur="showRightSearch=false" 
			v-model="keyword"
			:confirmText="$t('取消')" @confirm="search" :showRight="showRightSearch">
		</tm-search>
		<view class="chat-no">
			<text>我的通讯号：{{userInfo.chatNo||$t('未设置')}}</text>
		</view>
		<tm-grouplist title="" title-theme="blue text" :margin="[0,0]" :round="0">
			<tm-listitem
				:left-icon-size="60"
				value=""
				title="扫一扫"
				label="扫描二维码名牌"
				left-icon="myicon-scan"
				show-left-icon
			></tm-listitem>
			<tm-listitem
				:left-icon-size="60"
				value=""
				title="新建群聊"
				label="邀请多个好友一起聊天"
				left-icon="myicon-shuyi_qunliao"
				show-left-icon
			></tm-listitem>
			<tm-listitem
				:left-icon-size="60"
				value=""
				title="附近的人"
				label="附近的人附近的人"
				left-icon="myicon-weizhi"
				show-left-icon
			></tm-listitem>
		</tm-grouplist>
	</tm-fullView>
</template>

<script>
	import FriendApi from '@/api/friend.js'
	export default {
		data() {
			return {
				showRightSearch:false,
				keyword:'623186518@qq.com'
			}
		},
		methods: {
			search(keyword){
				let self=this
				if(keyword==''){
					return
				}
				uni.showLoading({
					title:self.$t('搜索中')
				})
				FriendApi.search({keyword}).then(res=>{
					self.toast(res.msg)
					if(res.code==200){
						self.navto("/friend/user?userId="+res.data.userId)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.chat-no{
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	padding: 40rpx 20rpx;
}
</style>
